package org.alex.nettychat.netty.custom.console;

import io.netty.channel.Channel;
import org.alex.nettychat.netty.custom.protocol.GetGroupInfoRequestPacket;

import java.util.Scanner;

/**
 * @author : alex
 */
public class GetGroupInfo implements ConsoleCommand{
    @Override
    public void exec(Scanner scanner, Channel channel) {
        System.out.println("请输入群聊Id:");
        int groupId = Integer.valueOf(scanner.nextLine());
        GetGroupInfoRequestPacket requestPacket = new GetGroupInfoRequestPacket();
        requestPacket.setGroupId(groupId);
        channel.writeAndFlush(requestPacket);
    }
}
